Conversation
| { | ||
| enums.NameType.HOST_NAME: HostName | ||
| } | ||
| ) |
There was a problem hiding this comment.
Perhaps EnumSwitch would go better here
1 similar comment
1 similar comment
|
I'm not very happy about doing Thoughts? |
markrwilliams
left a comment
There was a problem hiding this comment.
Looks good! I addressed your comment in my review.
Otherwise this looks great! I'm looking forward to the next review.
Thanks so much for getting extension parsing working!!
| { | ||
| enums.NameType.HOST_NAME: HostName | ||
| } | ||
| ) |
tls/_constructs.py
Outdated
| Array(lambda ctx: ctx.length, UBInt8("compression_methods")) | ||
| ) | ||
|
|
||
| HostName = Struct( |
There was a problem hiding this comment.
From @ashfall's comment on this PR:
I'm not very happy about doing server_name_list[0].name.data and would rather 'localhost' be server_name_list[0].name, i.e. not have the HostName container as a thing.
I think you can remove the Struct and name the PrefixedBytes hostname:
HostName = PrefixedBytes("hostname", UBInt16("length"))But I haven't tested it.
2 similar comments
markrwilliams
left a comment
There was a problem hiding this comment.
A question and a docstring spelling issue.
Thanks so much for working on this!
tls/test/test_hello_message.py
Outdated
| :func:`parse_server_hello` returns an instance of :class:`ServerHello` | ||
| with extensions, when the extension bytes are present in the input. | ||
| :func:`parse_server_hello` fails to parse when | ||
| SIGNATURE_ALGORITHMS extention bytes are present in the packet |
There was a problem hiding this comment.
Looks like the docs build failure is due to extention:
| :return: ClientHello object. | ||
| """ | ||
| construct = _constructs.ClientHello.parse(bytes) | ||
| if any(extension.type not in cls.allowed_extensions |
There was a problem hiding this comment.
This was an excellent catch! Should as_bytes also have this check, so that it's not possible to serialize a hello message that contains invalid extensions?
|
@markrwilliams Thanks for the review, updates coming! I have a question for you about the Since we haven't implemented the To define a default, and it was unclear to me how/where to provide the To make my test pass, I hacked around a bit and made the following changes: I modified And added a default This made All the hackery aside, is there an existing way to provide default values to |
3 similar comments
…er hello. Also fix the bug where signature_algorithm extension was parsed and tested with serverhello.
f80712a to
7c77cc8
Compare
|
@ashfall This looks great! I'm going to merge. We can address any lingering concerns in subsequent PRs. Thanks so much for implementing this! |
Implementing as specified in https://tools.ietf.org/html/rfc6066#section-3